package com.chandon.T02_functional;

import com.chandon.common.Cv;

import java.util.function.UnaryOperator;

/**
 * UnaryOperator<T>
 * 对输入的泛型操作，返回一个泛型类型相同的类型
 *
 * @author Dong
 * @version 1.0
 * @date 2021-04-18 12:48
 */

public class T05_TestUnaryOpereator {
    public static void main(String[] args) {

        UnaryOperator<Cv> unaryOperator = cv -> {
            Cv cv1 = new Cv();
            cv1.setAge(19);
            cv1.setName("asamiy");
            return cv1;
        };

        Cv cv = unaryOperator.apply(new Cv());
        System.out.println(cv.getAge());


    }
}
